package com.hunttown.mes.rpc.domain;

import java.io.Serializable;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Objects;

/**
 * created by wangjunfu on 2019-07-07 10:50:08
 */
public class TransportInvoiceDTO implements Serializable {
    private Integer id;
    private Integer entId;
    private Integer tableId;
    private Integer recordId;
    private Integer invoiceType;
    private Integer invoiceCompany;
    private String unitName;
    private String taxCode;
    private String unitAddress;
    private String mobile;
    private String openBack;
    private String backAccount;
    private String remark;
    private BigDecimal invoiceAmount;
    private BigDecimal invoiceAmountReal;
    private Integer sendType;
    private Integer invoicePeople;
    private Date invoiceDate;
    private Integer invoiceSendPeople;
    private Integer status;
    private String returnReason;
    private Integer adminId;
    private Date createTime;
    private Integer stopFlag;
    private Integer deleteFlag;

    private String tableName;
    private String invoicePeopleCn;
    private String invoiceSendPeopleCn;
    private String statusName;
    private String invoiceDateSr;
    private String businessTitle;
    private String companyName;
    private String invoiceTypeName;
    private String invoiceCompanyName;
    private String sendTypeName;

    private String checkoutRemark;  //结账单备注
    private String invoiceAmountRealSr;

    //以下内容由Alt+Ins快捷生成

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getEntId() {
        return entId;
    }

    public void setEntId(Integer entId) {
        this.entId = entId;
    }

    public Integer getTableId() {
        return tableId;
    }

    public void setTableId(Integer tableId) {
        this.tableId = tableId;
    }

    public Integer getRecordId() {
        return recordId;
    }

    public void setRecordId(Integer recordId) {
        this.recordId = recordId;
    }

    public Integer getInvoiceType() {
        return invoiceType;
    }

    public void setInvoiceType(Integer invoiceType) {
        this.invoiceType = invoiceType;
    }

    public Integer getInvoiceCompany() {
        return invoiceCompany;
    }

    public void setInvoiceCompany(Integer invoiceCompany) {
        this.invoiceCompany = invoiceCompany;
    }

    public String getUnitName() {
        return unitName;
    }

    public void setUnitName(String unitName) {
        this.unitName = unitName;
    }

    public String getTaxCode() {
        return taxCode;
    }

    public void setTaxCode(String taxCode) {
        this.taxCode = taxCode;
    }

    public String getUnitAddress() {
        return unitAddress;
    }

    public void setUnitAddress(String unitAddress) {
        this.unitAddress = unitAddress;
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public String getOpenBack() {
        return openBack;
    }

    public void setOpenBack(String openBack) {
        this.openBack = openBack;
    }

    public String getBackAccount() {
        return backAccount;
    }

    public void setBackAccount(String backAccount) {
        this.backAccount = backAccount;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public BigDecimal getInvoiceAmount() {
        return invoiceAmount;
    }

    public void setInvoiceAmount(BigDecimal invoiceAmount) {
        this.invoiceAmount = invoiceAmount;
    }

    public BigDecimal getInvoiceAmountReal() {
        return invoiceAmountReal;
    }

    public void setInvoiceAmountReal(BigDecimal invoiceAmountReal) {
        this.invoiceAmountReal = invoiceAmountReal;
    }

    public Integer getSendType() {
        return sendType;
    }

    public void setSendType(Integer sendType) {
        this.sendType = sendType;
    }

    public Integer getInvoicePeople() {
        return invoicePeople;
    }

    public void setInvoicePeople(Integer invoicePeople) {
        this.invoicePeople = invoicePeople;
    }

    public Date getInvoiceDate() {
        return invoiceDate;
    }

    public void setInvoiceDate(Date invoiceDate) {
        this.invoiceDate = invoiceDate;
    }

    public Integer getInvoiceSendPeople() {
        return invoiceSendPeople;
    }

    public void setInvoiceSendPeople(Integer invoiceSendPeople) {
        this.invoiceSendPeople = invoiceSendPeople;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getReturnReason() {
        return returnReason;
    }

    public void setReturnReason(String returnReason) {
        this.returnReason = returnReason;
    }

    public Integer getAdminId() {
        return adminId;
    }

    public void setAdminId(Integer adminId) {
        this.adminId = adminId;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Integer getStopFlag() {
        return stopFlag;
    }

    public void setStopFlag(Integer stopFlag) {
        this.stopFlag = stopFlag;
    }

    public Integer getDeleteFlag() {
        return deleteFlag;
    }

    public void setDeleteFlag(Integer deleteFlag) {
        this.deleteFlag = deleteFlag;
    }

    public String getTableName() {
        return tableName;
    }

    public void setTableName(String tableName) {
        this.tableName = tableName;
    }

    public String getInvoicePeopleCn() {
        return invoicePeopleCn;
    }

    public void setInvoicePeopleCn(String invoicePeopleCn) {
        this.invoicePeopleCn = invoicePeopleCn;
    }

    public String getInvoiceSendPeopleCn() {
        return invoiceSendPeopleCn;
    }

    public void setInvoiceSendPeopleCn(String invoiceSendPeopleCn) {
        this.invoiceSendPeopleCn = invoiceSendPeopleCn;
    }

    public String getStatusName() {
        return statusName;
    }

    public void setStatusName(String statusName) {
        this.statusName = statusName;
    }

    public String getInvoiceDateSr() {
        if (invoiceDateSr == null || invoiceDateSr.equals("")) {
            SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");

            if (invoiceDate == null) {
                return "1990-01-01";
            } else {
                return df.format(new Date(invoiceDate.getTime()));
            }
        } else {
            return invoiceDateSr;
        }
    }

    public void setInvoiceDateSr(String invoiceDateSr) {
        this.invoiceDateSr = invoiceDateSr;
    }

    public String getBusinessTitle() {
        return businessTitle;
    }

    public void setBusinessTitle(String businessTitle) {
        this.businessTitle = businessTitle;
    }

    public String getCompanyName() {
        return companyName;
    }

    public void setCompanyName(String companyName) {
        this.companyName = companyName;
    }

    public String getInvoiceTypeName() {
        return invoiceTypeName;
    }

    public void setInvoiceTypeName(String invoiceTypeName) {
        this.invoiceTypeName = invoiceTypeName;
    }

    public String getInvoiceCompanyName() {
        return invoiceCompanyName;
    }

    public void setInvoiceCompanyName(String invoiceCompanyName) {
        this.invoiceCompanyName = invoiceCompanyName;
    }

    public String getSendTypeName() {
        return sendTypeName;
    }

    public void setSendTypeName(String sendTypeName) {
        this.sendTypeName = sendTypeName;
    }

    public String getCheckoutRemark() {
        return checkoutRemark;
    }

    public void setCheckoutRemark(String checkoutRemark) {
        this.checkoutRemark = checkoutRemark;
    }

    public String getInvoiceAmountRealSr() {
        if (this.invoiceAmountReal == null) {
            return invoiceAmountRealSr;
        }

        if (Objects.equals(this.invoiceAmountReal.toString(), "0.00")) {
            return this.invoiceAmountReal + "";
        }

        if (this.invoiceAmountReal.toString().endsWith(".00")) {
            return this.invoiceAmountReal.toString().replace(".00", "");
        }

        return invoiceAmountReal + "";
    }

    public void setInvoiceAmountRealSr(String invoiceAmountRealSr) {
        this.invoiceAmountRealSr = invoiceAmountRealSr;
    }
}